package com.lnsf.bookstore.system.borrow.service.impl;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.borrow.service.BorrowService;
import com.lnsf.bookstore.system.borrow.dao.BorrowMapper;
import com.lnsf.bookstore.system.borrow.vo.Borrow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class BorrowServiceImpl implements BorrowService {

    @Autowired
    private BorrowMapper borrowMapper;


    @Override
    public int save(Borrow borrow) {
        return borrowMapper.insertSelective(borrow);
    }

    @Override
    public Borrow queryObject(Integer id) {
        return borrowMapper.queryObject(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return borrowMapper.deleteBatch(ids);
    }

    @Override
    public int update(Borrow borrow) {
        return borrowMapper.updateByPrimaryKeySelective(borrow);
    }

    @Override
    public PageInfo<Borrow> queryList(Map<String, Object> params) {
        return new PageInfo<Borrow>(borrowMapper.queryList(params));
    }
}
